// Copyright@ChenChao


#include "Items/Weapon/Weapon.h"

#include "Characters/RPG_CharacterBase.h"

AWeapon::AWeapon()
{
	ItemState = EItemState::EIS_Hovering;
}

/*装备武器函数*/
void AWeapon::F_Equip(USceneComponent* InParent, const FName InSocketName)
{
	const FAttachmentTransformRules TransformRules(EAttachmentRule::SnapToTarget, true);
	ItemMesh->AttachToComponent(InParent, TransformRules, InSocketName);
	ItemState = EItemState::EIS_Static;
}

/*重叠委托回调函数*/
void AWeapon::F_OnSphereOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor,
	UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)
{
	Super::F_OnSphereOverlap(OverlappedComponent, OtherActor, OtherComp, OtherBodyIndex, bFromSweep, SweepResult);
} 

/*重叠结束委托回调函数*/
void AWeapon::F_OnSphereEndOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor,
	UPrimitiveComponent* OtherComp, int32 OtherBodyIndex)
{
	Super::F_OnSphereEndOverlap(OverlappedComponent, OtherActor, OtherComp, OtherBodyIndex);
}

/*重叠物体上下浮动函数*/
void AWeapon::F_Float()
{
	Super::F_Float();
}
